package com.hghivln.controller;

import com.hghivln.pojo.vo.AjaxResult;
import com.netflix.hystrix.contrib.javanica.annotation.DefaultProperties;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;

@DefaultProperties(defaultFallback = "fallback",
commandProperties = {@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds",value = "5000")}) // 设置hystrix的熔断时间
public class BaseController {
    /**
     * 如果远程服务不可用，或者异常，回调的方法
     */
    public AjaxResult fallback() {
        return AjaxResult.fail("服务器内部异常，请联系管理员");
    }
}
